﻿using MessagePack;
using System;
using System.Collections.Generic;
using System.Text;

namespace Serializer
{
    [MessagePackObject]
    public class student 
    {
        [Key(0)]
        public string name { get; set; }
        [Key(1)]
        public Guid id { get; set; } = Guid.NewGuid();
        [Key(2)]
        public int age { get; set; } = 20;
    }
    public class TestClass
    {
        private ISerializer<student> _serializer;
        public TestClass(ISerializer<student> serializer) 
        {
            _serializer = serializer;
        }
        public void test() 
        {
            for (var i = 1; i < 11; i++) 
            {
                var str = Guid.NewGuid().ToString();
                var bytes = _serializer.Serialize(new student());
                var strvalue = _serializer.Deserialize(bytes);
                Console.WriteLine(strvalue);

            }
        }
    }

}
